#pragma once

#include <Wire.h>
#include "Common.h"

inline void SetLed( byte nr ) 
{
  static byte data;  // data to display on LEDs
  data =  0x01 << LedArray[nr] ;
  
  // send the data to the LEDs
  Wire.beginTransmission(IO_ADDR_LED_SNAIL_SHELL);
  Wire.write(~data);
  Wire.endTransmission();
}

#define DELAY_IN_MS 100
inline void DotheNightRider( ) 
{
  static unsigned char data = 0x01;  // data to display on LEDs

  for( int i=0; i<sizeof(LedArray); i++) {

    data =  0x01 << LedArray[i] ;

    // send the data to the LEDs
    Wire.beginTransmission(IO_ADDR_LED_SNAIL_SHELL);
    Wire.write(~data);
    Wire.endTransmission();
    delay(DELAY_IN_MS); 

    data =  0 ;

    // send the data to the LEDs
    Wire.beginTransmission(IO_ADDR_LED_SNAIL_SHELL);
    Wire.write(~data);
    Wire.endTransmission();
  }

  return;
}


